<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>zhaozhishu</title>
</head>
<body>
    <script>
        console.log(zhaozhishu(100000))
        function zhaozhishu(n){
            arr = []
            sum = 0;
            for(var i=2;i<=n;i++){
                for(var j=2;j<=i;j++){
                    if(i%j == 0&&i!=j){
                        break;
                    }
                    if(i==j){
                        sum+=1
                        arr.push(i)
                    }
                }
            }
            return n+"以内共"+sum+"个质数，分别为："+arr;
        }
    </script>
</body>
</html>